 /**
  * 复制功能，通过传入值实现复制
  * @param {*file_name:文件名
  *         *file_path:文件路径
  *         }  
  */
 
  downloadfun(file_name,file_path){
    var ajax=new XMLHttpRequest();
    ajax.open( "GET", file_path, true);
    ajax.setRequestHeader("Cache-Control","no-cache")
    ajax.setRequestHeader('Access-Control-Allow-Origin', '*');
    ajax.responseType = 'blob';
    ajax.onload = e =>{
      let res = e.target.response
      // let blob = new Blob([res],{type: "application/pdf;charset=UTF-8"}) // 这里的res为后端返回的流数据
      let blob = new Blob([res])
      let aLink = document.createElement("a")
      aLink.download = file_name // 下载文件的名字
      aLink.href = URL.createObjectURL(blob)
      aLink.click()
    }
    ajax.send()
  }
  downloadfun()